# NOTE:
# I am a fucker builder, I don't provide any safe PKGBUILD
# and I always install to /usr/local/bin/ 

# must define
pkgname=qet
pkgrel=1
pkgver=0.0.1
pkgdesc="qrcode-extraction-tool from ppm files(Maybe not really work)"
arch=('x86_64') #this is an array
license=('GPLv2') #this is an array
sha512sums=('SKIP')
depends=('xmake' 'gcc' 'make')

# NOTE: make sure this source is not dead
source=("https://gitee.com/dasdot/qrcode-extraction-tool/releases/download/linux-qet/qet.tar.gz")

build() {
  #default in dir src
  echo "NOTE: +++++++++++++++++" ${PWD}
  # I not using $srcdir
  
  cd ..
  echo "NOTE: +++++++++++++++++" ${PWD}
  #rm -rf pkg src
  tar xvfh qet.tar.gz
  make
}

package() {
  echo "NOTE: ++++++++++++++++++++=" ${srcdir}
  echo "NOTE: ++++++++++++++++++++=" ${pkgdir}

  echo "NOTE: +++++++++++++++++++++" ${PWD}
  cd ..
  strip -S -s -x bin/qet 
  # install tv not tv.1
  sudo cp bin/qet /usr/local/bin/qet 
}
